[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Random                   Returns Pseudo-Random Value

 Random : Real;                                                          [TP]
 Random(Max : Integer) : Integer;                                        [TP]

    If no maximum parameter is specified, this function returns a (pseudo)
    random real value in the range 0.0 to (but not including) 1.0. If Max
    is specified, this function returns a (pseudo) random integer value in
    the range 0..Max-1.

             Max    An integer value (constant, variable, function call or
                    expression).

         Limits:    none

           Note:    Note that Random (Max) = Trunc (Random * Max);

  -------------------------------- Example ---------------------------------

           X := Random;             { 0.0 <= X < 1.0 }
           I := Random(1000);       {   0 <= I < 1000 }

See Also: Randomize
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson